
#ifndef _ALITTLE_CAMERASYSTEM_H_
#define _ALITTLE_CAMERASYSTEM_H_

#include <ALittleClient/Common/Vector3.h>
#include <ALittleClient/Common/Matrix4.h>

namespace ALittle
{

class CameraSystem
{
public:
	static CameraSystem& Instance();
	void RegisterToScript();

public:
    void SetPosition(float x, float y, float z);
    void SetForward(float x, float y, float z);
    void SetUpward(float x, float y, float z);

public:
	void MoveByLeft(float step);
	void MoveByForward(float step);
	void MoveByUpward(float step);

public:
	void RotateByLeft(float angle);
	void RotateByForward(float angle);
    void RotateByUpward(float angle);

public:
	void PushCamera();

private:
	void CalcMatrix();

private:
	Vector3 m_position;
	Vector3 m_forward;
	Vector3 m_upward;
	Vector3 m_leftward;

private:
	bool m_changed;
	Matrix4 m_matrix;

private:
	CameraSystem();
	~CameraSystem();
};

} // ALittle

#define g_CameraSystem ALittle::CameraSystem::Instance()

#endif // _ALITTLE_CAMERASYSTEM_H_
